package com.youkeyi.ddy.cloud.common.api.basic.pub.organization;

import com.youkeyi.ddy.cloud.common.api.basic.pub.organization.dto.PublicOrganizationListCloudDto;
import com.youkeyi.ddy.cloud.common.api.basic.pub.organization.dto.PublicOrganizationTreeItemCloudDto;
import com.youkeyi.ddy.cloud.common.api.basic.pub.organization.param.*;
import com.youkeyi.ddy.cloud.common.response.ResponseContent;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * PublicOrganizationCloudService
 *
 * @Author liuxiawang
 * @Date 2024/2/19 2:31 PM
 * @Location shenzhen.china
 */
@RestController
@FeignClient(value = "YOUKEYI-DDY-CLOUD-BASIC-PUBLIC", fallback = PublicOrganizationCloudServiceFallback.class)
@RequestMapping("/public/organization")
public interface PublicOrganizationCloudService {

    /**
     * 查询组织列表.
     *
     * @param param the param
     * @return the server list cloud dto
     */
    @PostMapping(value = "/query")
    public abstract PublicOrganizationListCloudDto query(@RequestBody PublicOrganizationQueryCloudParam param);

    /**
     * 查询组织Tree.
     *
     * @param param the param
     * @return the server list cloud dto
     */
    @PostMapping(value = "/query/tree")
    public abstract List<PublicOrganizationTreeItemCloudDto> queryTree(@RequestBody PublicOrganizationQueryTreeCloudParam param);

    /**
     * 新增组织.
     *
     * @param param the param
     * @return the response content
     */
    @PostMapping(value = "/create")
    public abstract ResponseContent create(@RequestBody PublicOrganizationCreateCloudParam param);

    /**
     * 编辑组织.
     *
     * @param param the param
     * @return the response content
     */
    @PostMapping(value = "/update")
    public abstract ResponseContent update(@RequestBody PublicOrganizationUpdateCloudParam param);

    /**
     * 删除组织.
     *
     * @param param the param
     * @return the response content
     */
    @PostMapping(value = "/delete")
    public abstract ResponseContent delete(@RequestBody PublicOrganizationDeleteCloudParam param);
}
